﻿namespace Games.HuaRongDao
{
    class Block
    {
        public Block(int id, int x, int y, int width, int height, int imageId, string name)
        {
            this.ID = id;
            this.X = x;
            this.Y = y;
            this.Width = width;
            this.Height = height;
            this.ImageId = imageId;
            this.Name = name;
        }

        public int ID { get; }
        public int X { get; internal set; }
        public int Y { get; internal set; }
        public int Width { get; }
        public int Height { get; }
        public int ImageId { get; }
        public string Name { get; }
        public int GetStatus()
        {
            var v = 0;
            for(int i = 0; i < Height; i++)
            {
                for(int j = 0; j < Width; j++)
                {
                    var b = (Y + i) * 4 + X + j;
                    v |= 1 << b;
                }
            }
            return v;
        }
    }
}
